package ch08;

import java.awt.Rectangle;

public class DataSetTester {
	
	public static void main(String[] args)
	{
		IMeasurer m = new RectangleMeasurer();
		
		DataSet data = new DataSet(m);
		
		data.add(new Rectangle(5, 10, 20, 30));
		data.add(new Rectangle(10, 20, 30, 40));
		data.add(new Rectangle(20, 30, 5, 15));
		
		System.out.println("Averate area: " + data.getAverage());
		System.out.println("Expected: 625");
		
		Rectangle max = (Rectangle) data.getMaximum();
		System.out.println("Max rect: " + max);
		System.out.println("Expected: " + "java.awt.Rectangle[x=10,y=20,width=30,height=40]");
	}

}
